package com.deer.wms.system.manage.service;

import com.deer.wms.intercept.common.data.CurrentUser;
import com.deer.wms.project.root.core.result.Result;
import com.deer.wms.project.root.service.SuperService;
import com.deer.wms.system.manage.model.customer.Customer;
import com.deer.wms.system.manage.model.customer.CustomerCriteria;
import com.deer.wms.system.manage.model.customer.CustomerDto;

import java.util.List;


/**
 *
 * @author guo
 * @since 2019/11/13
 */
public interface CustomerService extends SuperService<Customer> {

    /**
     * 按条件查询List
     * @param criteria criteria
     * @return List<CustomerDto>
     */
    List<CustomerDto> findList(CustomerCriteria criteria);

    /**
     * 通过编码查询
     * @param customerCode 客户编码
     * @return List<CustomerDto>
     */
    List<CustomerDto> findByCustomerCode(String customerCode);

    /**
     * 通过名称查询
     * @param customerName  客户名称
     * @return List<CustomerDto>
     */
    List<CustomerDto> findByCustomerName(String customerName);

    /**
     * 新增
     * @param customer 客户
     * @param currentUser 当前用户
     * @return Result
     */
    public Result createCustomer(CustomerDto customer, CurrentUser currentUser);

    /**
     * 按照字段查询
     * @param field 字段
     * @param value 值
     * @return Customer
     */
    Customer findBy(String field, String value);
}
